﻿

namespace MITC.Portal.Core.Entitys.Configuration.LayoutsConfg
{
    #region refer
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using MITC.Portal.Core.Entitys.Configuration.LayoutsConfg;
    using Mitc.Portal2010.Core.Entity.ConfigWebpart;
    using SPGenesis.Core;
    using SPGenesis.Entities;
    #endregion
    public class LayoutConfigMapping : SPGENEntityMap<LayoutEntity>
    {
        protected override void InitializeMapper()
        {
            RegisterIdentifierProperty(p => p.ID);
            MapField(p => p.Title, "Title");
            MapField(p => p.PositionContent, LayoutIntance.PositionContent.InternalName);
            MapField(p => p.TableColumn, LayoutIntance.TableColumn.InternalName);
            MapField(p => p.PlaceHolderId, LayoutIntance.PlaceHolderId.InternalName);
            MapField(p => p.Tabship, LayoutIntance.Tabship.InternalName);
            MapField(p => p.PositionFixed, LayoutIntance.PositionFixed.InternalName);
            MapField(p => p.LoadSubContent, LayoutIntance.LoadSubContent.InternalName);
            MapField(p => p.UrlContent, LayoutIntance.UrlContent.InternalName);
            MapField(p => p.ContentHtml, LayoutIntance.ContentHtml.InternalName);

            MapFieldToEnum<FixedPosition>(p => p.FixPosition, LayoutIntance.FixPosition.InternalName, SPGENEntityEnumMappingOptions.ChoiceMappings);
        }
    }
}